]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Only enable window screenshots when allowed by mode
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 21 Aug 2022 19:07:52 +0000 (21:07 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 22 Aug 2022 14:15:17 +0000 (14:15 +0000)
We currently don't take the session mode's `hasWindows` property
into account when deciding whether window screenshots should be
allowed. Right now that doesn't matter in practice, because all
the ways to bring up the screenshot UI are blocked in those modes
anyway. This is about to change though, so take the property into
account to prevent an information leak.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2439>

js/ui/screenshot.js

index d82d7a7a62475891fe379c6fbb7145019a268bd0..e6ead6127390599f828001d44e15a20874bfa8d4 100644 (file)
@@ -1469,7 +1469,9 @@ var ScreenshotUI = GObject.registerClass({
             }
 
             this._windowButton.reactive =
-                windows.length > 0 && !this._castButton.checked;
+                Main.sessionMode.hasWindows &&
+                windows.length > 0 &&
+                !this._castButton.checked;
             if (!this._windowButton.reactive)
                 this._selectionButton.checked = true;